/*
 * Michelle Chen
 * Period 1
 * Semester 1 Final Project
 * Piece.java
 * Class 2: Req 5
 * Game Piece on the board
 * Basis for the superPiece 
 */

package bejeweled;

public class Piece
{
    private String imageSuffix;
    private Integer[] points; 
    
    /** Creates a new instance of Piece */
    public Piece (String imageSuffix)
    {
        this.imageSuffix = imageSuffix;

    }
    
    /**
     * Method returns the color of the piece
     * @return color of the piece
     */
    public String getImageSuffix()
    {
        return imageSuffix;
    }
    
    /**
     * Method returns whether or not this color matches the other piece
     * @return true if the pieces do match and false if they are different
     */ 
    @Override
    public boolean equals (Object obj)
    {
        Piece other = (Piece)obj;
        return imageSuffix.equals(other.imageSuffix);    
    }
    
    @Override
    /**
     * Method overrides the toString method and returns the imageSuffix
     * @return  String: suffix of Image
     */
    public String toString()
    {
        return imageSuffix;
    }
    
    /**
     * method determines whether or not the piece is a part of the background
     * @return true if piece is backgroud
     */
    public boolean isBackground()
    {
        return "".equals(imageSuffix); 
    }
    
    /**
     * each piece color has a different point value. method returns the value
     * only the penguin piece is worth 10 points. All the other pieces are set at 5 pts
     * @return the value of the piece 
     */
    public int getPointValue()
    {
        if (imageSuffix.equals("penguin"))
            return 10; 
        return 5; 
    }
    
    /**
     * determines whether or not the piece can change other pieces
     * @return false when the piece does not interact with rest of board
     */
    public boolean interact()
    {
        return false; 
    }
    
}
